package com.karolak.web.saf.action;

import com.karolak.entity.Person;
import com.karolak.entity.constant.Gender;
import com.karolak.service.Service;

// TODO investigate
//public abstract class AbstractPersonAction<T extends Person, S extends GenericSimplePersonService<T>> extends CrudAction<T, Integer, S> {
public abstract class AbstractPersonAction<T extends Person, S extends Service<T, Integer>> extends CrudAction<T, Integer, S> {

	private static final long serialVersionUID = 1L;

	// === get/set === //
	@Override
	public Integer getModelId() {
		if (getModel() == null) {
			return null;
		}
		return getModel().getId();
	}

	@Override
	public String[] getSortProperties() {
		return new String[] { "lastName" };
	}

	public Gender[] getGenders() {
		return Gender.values();
	}
}
